function disconnectTip() {
	$().alert({
		"content" : "服务器连接已断开，请重新连接！"
	});
}
// 游戏是否正在进行中
function isGameOnGoing() {
	return dataStorage.get(OtherThing.isGameOnGoing) === 'true';
}

function getMyPlayerId() {
	return dataStorage.get(MyOwner.playerId);
}

function getMySit() {
	return dataStorage.get(MyOwner.sit);
}

function getMyUserId() {
	return dataStorage.get(MyOwner.userId);
}

function isOnMyRight(mySit, otherSit) {
	return (mySit + 1) % 3 == otherSit;
}

function isOnMyLeft(mySit, otherSit) {
	return (mySit + 2) % 3 == otherSit;
}

// 获取时钟的倒计时
function getTimeOutStartTimeStamp() {
	return dataStorage.get(OtherThing.timeOutStartTimeStamp);
}

// 保存时钟的倒计时
function setTimeOutStartTimeStamp(timeOutStartTimeStamp) {
	dataStorage.set(OtherThing.timeOutStartTimeStamp, timeOutStartTimeStamp);
}

// 手牌与底牌数组合并
function megerCardsArr(cardIdArr1, cardIdArr2) {

	var newCardIdArr = new Array(cardIdArr1.length + cardIdArr2.length);
	var i = 0, j = 0, position = 0;
	while (i < cardIdArr1.length && j < cardIdArr2.length) {
		// 要强制转化成Number型，因为数字比较实际上不是直接按照大小比较的，导致出来的结果有误
		if (Number(cardIdArr1[i]) < Number(cardIdArr2[j])) {
			newCardIdArr[position++] = Number(cardIdArr1[i]);
			i++;
		} else {
			newCardIdArr[position++] = Number(cardIdArr2[j]);
			j++;
		}
	}
	while (i < cardIdArr1.length) {
		newCardIdArr[position++] = Number(cardIdArr1[i++]);
	}
	while (j < cardIdArr2.length) {
		newCardIdArr[position++] = Number(cardIdArr2[j++]);
	}
	return newCardIdArr;

}

function getPerOutCards() {
	var perOutCards = dataStorage.get(OtherThing.perOutCards).split(",");
	return getNumArray(perOutCards);
}

// 当cardsArr为""时，返回的Number值为0;
function getNumArray(cardsArr) {
	var arr = new Array();
	for ( var i = 0; i < cardsArr.length; i++) {
		arr[i] = Number(cardsArr[i]);
	}
	return arr;
}
// 断线重连次数是否得到最大值
function reconnectCountUpToMax() {
	var count = 0;
	if (dataStorage.get(OtherThing.reConnectCount)) {
		count = Number(dataStorage.get(OtherThing.reConnectCount));
	}
	console.log("reconnectCountUpToMax -> " + count);
	return count == 15;
}
// 增加断线重连记数器
function addReconnectCount() {
	var count = 0;
	if (dataStorage.get(OtherThing.reConnectCount)) {
		count = Number(dataStorage.get(OtherThing.reConnectCount));
		count++;
	}
	dataStorage.set(OtherThing.reConnectCount, count);
}

function isStartFromMe() {
	return dataStorage.get(OtherThing.isStartFromMe);
}

function isManaged() {
	return dataStorage.get(OtherThing.isManaged);
}

function getRoomId() {
	return dataStorage.get(MyOwner.roomId);
}

function setRoomId(roomId) {
	dataStorage.set(MyOwner.roomId, roomId);
}